-
-
Notifications
You must be signed in to change notification settings - Fork 60
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix Race Condition between the Creation of the S3 Bucket Policy and the CloudTrail Trail #91
Fix Race Condition between the Creation of the S3 Bucket Policy and the CloudTrail Trail #91
Conversation
/terratest |
/terratest |
What version of terraform are you using? |
The Terraform version is not relevant. It is the AWS CloudTrail |
/terratest |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I am uncomfortable allowing the use of an undocumented feature, and this should probably be fixed upstream in terraform-aws-s3-bucket, but it works with Terraform 1.3, 1.5, and 1.8 and I don't see a better way to achieve the desired result, so I will allow this and we can see how it goes.
Thank for merging this @Nuru. If you are talking about the
And |
I take it back. The cloudtrail module was missing a depends_on cloudtrail_s3_bucket, due to s3_bucket_name being static. |
what
Fix the race condition between the creation of the S3 Bucket policy and the CloudTrail trail by adding a
depends_on
argument to thebucket_id
output which is used as input to the CloudTrail module. This ensures that all the resources in the CloudTrail S3 Bucket module, including the S3 Bucket Policy have been created before the CloudTrail trail is created.The example used for the tests has also been updated to include the creation of the CloudTrail Trail to verify that this is working.
why